﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="Accounts.ascx.cs" Inherits="Doctors_WebForum.Admin.UIControls.Accounts" %>

<script src="Js/style.js" type="text/javascript"></script>
<script type="text/javascript">
// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=no,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>

<div class="tab_content">
    <div class="pageIntro">
        <h2>
            Managerment Account</h2>
        <p>
            Here's administrator can update/view information for Users</p>
    </div>
    <div class="contentBox">
        <div class="contentBoxTop">
            <h3>
                <asp:LinkButton ID="lbkListUser" runat="server" OnClick="lbkListUser_Click">List information all about members is exits in forum</asp:LinkButton></h3>
            <label id="search" class="smallInput">
                Quick Find :
                <asp:TextBox AutoPostBack="true" ValidationGroup="QuickFind" ID="txtSearch" runat="server" OnTextChanged="txtSearch_TextChanged"></asp:TextBox>
            </label>
        </div>
        <div class="adventureSearch">
            <a title="Filter adventure">
                <img src="images/arrow_hover.jpg" alt="" /></a>
        </div>
        <div class="contentSearch">
            <div>
                <strong>Filter Adventure</strong>
                <table>
                    <thead>
                        <tr>
                            <td>
                                UserName
                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
                            <td>
                                CreateDate
                                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                Actived
                                <asp:DropDownList ID="drActive" runat="server">
                                    <asp:ListItem Text='Active'></asp:ListItem>
                                    <asp:ListItem Text='unActive'></asp:ListItem>
                                </asp:DropDownList></td>
                            <td>
                                RoleName
                                <asp:DropDownList ID="drRole" runat="server">
                                    <asp:ListItem Text='Administrator'></asp:ListItem>
                                    <asp:ListItem Text='Member'></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td id="filterEmail">
                                Email
                                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                LastLogin
                                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                Banned
                                <asp:DropDownList ID="drBan" runat="server">
                                    <asp:ListItem Text='Ban'></asp:ListItem>
                                    <asp:ListItem Text='UnBan'></asp:ListItem>
                                </asp:DropDownList></td>
                            <td>
                                Sorted
                                <asp:DropDownList ID="drSort" runat="server">
                                    <asp:ListItem Text='Ascending'></asp:ListItem>
                                    <asp:ListItem Text='Descending'></asp:ListItem>
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td id="btnFilter">
                                <asp:Button ID="btnFilterAdvence" runat="server" Text="Filter" OnClick="btnFilterAdvence_Click" />
                            </td>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="innerContent">
            <!--Message will active if cann not load data-->
            <asp:Label ID="lblMessage" runat="server"></asp:Label>
            <!--Load list users with paging using datalist controls-->
            <asp:DataList ID="dtlUser" runat="server" CssClass="sTable" DataKeyField="UserID"
                OnEditCommand="dtlUser_EditCommand" OnCancelCommand="dtlUser_CancelCommand" OnUpdateCommand="dtlUser_UpdateCommand"
                OnItemDataBound="dtlUser_ItemDataBound">
                <HeaderTemplate>
                    <thead id="table_header">
                        <tr>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkSortName" OnClick="SortName" runat="server">UserName</asp:LinkButton></strong></th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkEmail" OnClick="SortEmail" runat="server">Email</asp:LinkButton></strong></th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkLastLogin" OnClick="LastLogin" runat="server">LastLogin</asp:LinkButton></strong></th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkCreateDate" OnClick="CreateDate" runat="server">CreateDate</asp:LinkButton></strong>
                            </th>
                            <th>
                                <strong>
                                    <asp:LinkButton ID="lbkRoleName" OnClick="RoleName" runat="server">RoleName</asp:LinkButton></strong></th>
                            <th>
                                <strong style="float: left;">
                                    <asp:LinkButton ID="lbkIsActive" OnClick="IsActive" runat="server">Actived</asp:LinkButton></strong></th>
                            <th>
                                <strong style="float: left;">
                                    <asp:LinkButton ID="lbkIsLock" OnClick="IsLock" runat="server">Banned</asp:LinkButton></strong></th>
                            <th>
                                <strong>Edit</strong></th>
                        </tr>
                    </thead>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="oddRow">
                        <a href="#" onclick="JavaScript:newPopup('DetailsObject.aspx?ID=<%#Eval("UserID") %>&view=acc');">
                            <td class="firstCol">
                                <%#DataBinder.Eval(Container.DataItem,"UserName")%>
                            </td>
                            <td class="secondCol">
                                <%#Eval("Email")%>
                            </td>
                            <td>
                                <%# Convert.ToDateTime(Eval("LastLogin")).ToShortDateString()%>
                            </td>
                            <td>
                                <%# Convert.ToDateTime(Eval("CreatedDate")).ToShortDateString()%>
                            </td>
                            <td>
                                <%#Eval("RoleName")%>
                            </td>
                            <td class="checkBox">
                                <%--OnCheckedChanged="chkStatus_OnCheckedChanged"--%>
                                <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsActive")) %>'
                                    Text='<%# Eval("IsActive").ToString().Equals("True") ? " Active " : " UnActive " %>' />
                            </td>
                            <td class="checkBox">
                                <asp:CheckBox ID="chkLock" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsBan")) %>'
                                    Text='<%# Eval("IsBan").ToString().Equals("True") ? " UnBan " : " Ban " %>' />
                            </td>
                        </a>
                        <td class="editItem">
                            <ul>
                                <li class="iconEdit">
                                    <asp:LinkButton Text="edit" CommandName="Edit" runat="server" ID="lbtnEdit" />
                                </li>
                                <%--<li class="iconDel"><a href="#">Lock</a></li>--%>
                            </ul>
                        </td>
                    </tr>
                </ItemTemplate>
                <EditItemTemplate>
                    <tr class="edit_content">
                        <td>
                            <%#Eval("UserName")%>
                        </td>
                        <td class="secondCol">
                            <%#Eval("Email")%>
                        </td>
                        <td>
                            <%# Convert.ToDateTime(Eval("LastLogin")).ToShortDateString()%>
                        </td>
                        <td>
                            <%# Convert.ToDateTime(Eval("CreatedDate")).ToShortDateString()%>
                        </td>
                        <td>
                            <asp:DropDownList ID="drpRole" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td class="checkBox">
                            <asp:CheckBox ID="chkStatus" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsActive")) %>'
                                Text='<%# Eval("IsActive").ToString().Equals("True") ? " Active " : " UnActive " %>' />
                        </td>
                        <td class="checkBox">
                            <asp:CheckBox ID="chkLock" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsBan")) %>'
                                Text='<%# Eval("IsBan").ToString().Equals("True") ? " Ban " : " UnBan " %>' />
                        </td>
                        <td class="editItem">
                            <ul>
                                <li class="iconCancel">
                                    <asp:LinkButton Text="cancel" CommandName="Cancel" runat="server" ID="lbtnCancel" />
                                </li>
                                <li class="iconUpdate">
                                    <asp:LinkButton Text="update" CommandName="Update" runat="server" ID="lbtnUpdate" />
                                </li>
                            </ul>
                        </td>
                    </tr>
                </EditItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:DataList>
            <asp:Label ID="lblResultPaging" runat="server" Visible="false"></asp:Label>
            <table border="0" cellpadding="0" cellspacing="0" id="pagging_box">
                <tr>
                    <td valign="middle">
                        <asp:LinkButton ID="lbtnPrevious" runat="server" Text="Previous Page" class="selected"
                            OnClick="lbtnPrevious_Click">Previous</asp:LinkButton>
                    </td>
                    <td valign="middle" align="right">
                        <asp:DataList ID="DLPAGING" runat="server" RepeatDirection="Horizontal" OnItemCommand="DLPAGING_ItemCommand">
                            <ItemTemplate>
                                <asp:LinkButton ID="imgbtnNumber" class="selected" runat="server" Text='<%# Eval("DisplayName") %>'
                                    Visible='<%# Eval("LinkButtonVisible") %>' CommandArgument='<%# Eval("Value") %>'
                                    CommandName="Paging" />
                                <asp:Label class="paging" ID="lblNumber" runat="server" ToolTip="Selected Page" Visible='<%# Eval("LabelVisible") %>'
                                    Text='<%# "&nbsp;"+ Eval("DisplayName") + "&nbsp;"%>'></asp:Label>
                            </ItemTemplate>
                        </asp:DataList>
                    </td>
                    <td valign="middle">
                        <asp:LinkButton ID="lbtnNext" runat="server" class="selected" Text="Next Page" OnClick="NextPage">Next</asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>
        <!--end of #box-3-->
    </div>
</div>
<!--The end contains control Account-->

<script type="text/javascript">
initShowHideDivs();

function OnClick()
{
  if( divCalendar.style.display == "none")
    divCalendar.style.display = "";
  else
    divCalendar.style.display = "none";
}
</script>

